
import request from '@/utils/request';

export function getRoutes(){
  return request({
    url:'/admin/channel/permission/getRoutes',
    method:'get'
  })
}

export function permissionMenu(query) {
  return request({
    url: `/admin/channel/permission/list${query}`,
    method: 'get',
  });
}

export function getMenu(query) {
  return request({
    url: '/admin/channel/menu/cachedata',
    method: 'get',
  });
}

export function saveMenu(form) {
  return request({
    url: '/admin/channel/permission/add',
    method: 'post',
    data: form
  });
}

export function updateMenu(form) {
  return request({
    url: '/admin/channel/permission/update',
    method: 'post',
    data: form
  });
}
export function cacheMenu() {
  return request({
    url: '/admin/channel/permission/cachedata',
    method: 'get',
  })
}

export function deleteSysUser(id) {
  return request({
    url: '/api/auth/auth/getDeleted?id=' + id,
    method: 'get'
  });
}

export function deleteMenu() {
  return Promise.reject(new Error('该接口暂时不可用！'))
}
